POV-Ray : Newsgroups : povray.general : General question about relative efficiency of CSG operations : Re: General question about relative efficiency of CSG operations Server Time
5 Aug 2024 12:20:30 EDT (-0400)
  Re: General question about relative efficiency of CSG operations  
From: LibraryMan
Date: 22 Nov 2002 13:40:04
Message: <3DDE7A07.B6D66C46@att.net>
As I replied to Bob Hughes, the stats in both the unioned version and
the diff'd version indicated that the scene contained 2 objects, which
mystified me, until I realized it was probably referring to the one
declared object, which I placed *2* instances of side-by-side in the
scene, like so:

[ #declare inter_arc = union { etc. ... } ]

object { inter_arc }  //which is 1.6 units wide
object { inter_arc translate x*1.6 }

I discovered that my default bounding threshold was 3, so I lowered it
to 2 for the sake of the experiment, and this DID improve the rendering
time of both versions SLIGHTLY, but the diff'd version still rendered a
little faster than the unioned version, which as stated in my original
posting, I thought was counter-intuitive.

I suppose I may not be the first ever person who ends up completely
re-writing his scene, once he learns more SDL...

Should I end up posting the code I'm talking about? Maybe someone else's
mileage will vary.  Yeah, what the hey!

---Mark


Mike Williams wrote:
> 
> Wasn't it LibraryMan who wrote:
> >I have an object which I created two versions of, which look quite
> >similar.  I had read somewhere on this group that in general, CSG
> >difference takes more time to trace than union.  But when I rendered the
> >two "versions" of the object in question ( a section of arcade from yet
> >another Gothic cathedral scene) the version with lots of difference's
> >rendered faster than the version that was all unioning and translating.
> 
> The problem with multiple differences is that POV can only set a single
> bounding slab for the whole thing. If you've got one big object with
> lots of little bits cut out of it, then POV ends up having to test every
> one of the CSG components for every ray. (See the "hole tutorial" at
> <http://www.econym.demon.co.uk/holetut/>). Whereas, for a union, POV can
> usually create a sensible hierarchy of bounding slabs, and only tests a
> small number of slabs and CSG components for each ray.
> 
> Perhaps you somehow managed to end up with sensible bounding in the
> differenced object, or with very poor bounding in the unioned object. It
> should be quite obvious from the stats if either of these is the case.
> 
> --
> Mike Williams
> Gentleman of Leisure


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.